var router = require('koa-router')();


router.get('/viewer/pdf', async (ctx, next)=>{
    await ctx.view("viewer/pdf")
});
router.get('/viewer/pdf/get', async (ctx, next)=>{
    let {file} = ctx.request.query;
    ctx.type = 'application/pdf';
    ctx.body = await ctx.get(file,{},{responseType:"stream"})
});



router.get('/viewer/word', async (ctx, next)=>{
    await ctx.view("viewer/word")
});

router.get('/viewer/word/test', async (ctx, next)=>{
	// ctx.socket.emit("hello", "调用的");
	// console.log(ctx.duhuijie , "---")
	ctx.duhuijie ()
    ctx.body = "ok"
});
router.all('/duhuijie', async (ctx, next)=>{
    ctx.body = "ok"
});


export default router;
